import Container from '../components/Container.vue'
import Home from '../views/home/index.vue'
import Login from '../views/login/index.vue'
import Goods from '../views/goods/index.vue'
import User from '../views/user/index.vue'
import Order from '../views/order/index.vue'
import Vip from '../views/vip/index.vue'
import Role from '../views/role/index.vue'
import Promotion from '../views/promotion/index.vue'
import Discount from '../views/promotion/discount.vue'
import FullDeduction from '../views/promotion/fullDeduction.vue'
import Coupon from '../views/promotion/coupon.vue'
export const routes = [

    {
        path: '/',
        redirect: '/home'         // 默认在Home页面，没有匹配到路由时使用
    },
    {
        path: '/login',
        component: Login,
    },
    {
        path: '/home',
        component: Container,
        children: [
            {
                path: '/home',
                component: Home,
                meta: { title: '首页', path: '/home' },
            },
            {
                path: '/user',
                component: User,
                meta: { title: '用户', path: '/user' },
            },
            {
                path: '/goods',
                component: Goods,
                meta: { title: '商品', path: '/goods' },
            },
            {
                path: '/order',
                component: Order,
                meta: { title: '订单', path: '/order' },
            },
            {
                path: '/vip',
                component: Vip,
                meta: { title: '会员', path: '/vip' },
            },
            {
                path: '/role',
                component: Role,
                meta: { title: '权限', path: '/role' },
            },
            {
                path: '/promotion',
                component: Promotion,
                meta: { title: '促销', path: '/promotion' },
                children: [
                    {
                        path: '/discount',
                        component: Discount,
                        meta: { title: '打折活动', path: '/discount' },
                    },
                    {
                        path: '/fullDeduction',
                        component: FullDeduction,
                        meta: { title: '满减活动', path: '/fullDeduction' },
                    },
                    {
                        path: '/coupon',
                        component: Coupon,
                        meta: { title: '优惠券', path: '/coupon' },
                    },
                ]
            },
        ]
    },
]